﻿using UnityEngine;
using System.Collections;


namespace GJXQGame
{
    public class Config
    {
        static private SceneConfig mSceneConfig;

        static public SceneConfig Scene
        {
            get
            {
                if (mSceneConfig == null)
                {
                    mSceneConfig = Resources.Load("Config/SceneConfig")  as SceneConfig;
                    mSceneConfig.Ready = true;
                    return mSceneConfig;

                    // TODO XYS: coroutine load
                    mSceneConfig = new SceneConfig();

                    GameRoot.StartCoroutine(ResourcesManager.CoroutineLoad(Global.LOCAL_RES_URL + "Config/SceneConfig.unity3d", loader =>
                    {
                        mSceneConfig = loader.assetBundle.mainAsset as SceneConfig;
                        mSceneConfig.Ready = true;
                    }));
                }

                return mSceneConfig;
            }
        }
    }
}
